﻿package  
{
	
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	public class PhotoUI extends MovieClip 
	{
		public var itemArray:Array = null;
		
		public var px:int = 136;
		public var py:int = 224;
		
		public function PhotoUI() 
		{
			// constructor code
			stop();
			
			closeBtn.addEventListener( MouseEvent.CLICK , onClick );
			
			itemArray = new Array();
			itemArray.push( item0 );
			itemArray.push( item1 );
			itemArray.push( item2 );
			itemArray.push( item3 );
			itemArray.push( item4 );
			itemArray.push( item5 );
			itemArray.push( item6 );
			itemArray.push( item7 );
			
			clear();
		}
		
		public function setPage( n:int ):void
		{
			pageText.text = n.toString();
		}
		
		public function clear():void
		{
			nameText.text = "";
			levelText.text = "";
			hpText.text = "";
			strText.text = "";
			tghText.text = "";
			dexText.text = "";
			
			for ( var i:int = 0 ; i < itemArray.length ; i++ )
			{
				itemArray[i].visible = false;
				itemArray[i].nameText.text = "";
				itemArray[i].levelText.text = "";
			}
		}
		
		public function setItem( i:int , l:int , n:String ):void
		{
			itemArray[i].visible = true;
			itemArray[i].nameText.text = n;
			itemArray[i].levelText.text = "NO." + l.toString();
		}
		
		public function setText( n:String , l:int , hp:int , str:int , tgh:int , dex:int ):void
		{
			nameText.text = n;
			levelText.text = l.toString();
			hpText.text = hp.toString();
			strText.text = str.toString();
			tghText.text = tgh.toString();
			dexText.text = dex.toString();
		}
		
		private function onClick( e:MouseEvent )
		{
			this.visible = false;
		}
	}
	
}
